package org.witsoft.dtx.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.witsoft.dtx.LocalTransactionManager;
import org.witsoft.dtx.component.TransactionManageRunner;
import org.witsoft.dtx.component.TransactionManageScheduler;
import org.witsoft.dtx.service.BranchTransactionService;
import org.witsoft.dtx.service.GlobalTransactionService;
import org.witsoft.dtx.service.TransactionManageService;
import org.witsoft.dtx.service.impl.BranchTransactionServiceImpl;
import org.witsoft.dtx.service.impl.GlobalTransactionServiceImpl;
import org.witsoft.dtx.service.impl.TransactionManageServiceImpl;

/**
 * @author XiaoQing Lin
 * @date 2020-09-21 16:21
 */
class DtxBaseConfiguration {

    @Bean
    public LocalTransactionManager dtxLocalTransactionManager(){
        return new LocalTransactionManager();
    }

    @Bean
    public GlobalTransactionService globalTransactionService(){
        return new GlobalTransactionServiceImpl();
    }

    @Bean
    public BranchTransactionService branchTransactionService(){
        return new BranchTransactionServiceImpl();
    }

    @Bean
    public TransactionManageService transactionManageService(){
        return new TransactionManageServiceImpl();
    }
}
